home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / bin / xft-config < prev    next >
Text File  |  2006-04-12  |  2KB  |  101 lines

  1. #! /bin/sh
  2.  
  3. prefix="/usr/X11R6"
  4. exec_prefix="/usr/bin"
  5. libdir="/usr/lib"
  6. includedir="/usr/include"
  7. version="2.1.2.2"
  8. freetypelibs="-L/usr/lib  -lfreetype"
  9. freetypecflags="-I/usr/include/freetype2 -I/usr/include/freetype2/config"
  10. fontconfiglibs="-lfontconfig"
  11. fontconfigcflags=""
  12. xrenderlibs="-L/usr/lib -lXrender"
  13. xrendercflags="-I/usr/include"
  14.  
  15. usage()
  16. {
  17.   cat <<EOF
  18. Usage: xft-config [OPTIONS] [LIBRARIES]
  19. Options:
  20.  [--prefix[=DIR]]
  21.  [--exec-prefix[=DIR]]
  22.  [--version]
  23.  [--libs]
  24.  [--cflags]
  25. EOF
  26.   exit $1
  27. }
  28.  
  29. if test $# -eq 0 ; then
  30.   usage 1 1>&2
  31. fi
  32.  
  33. while test $# -gt 0 ; do
  34.   case "$1" in
  35.   -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
  36.   *) optarg= ;;
  37.   esac
  38.  
  39.   case $1 in
  40.   --prefix=*)
  41.     prefix=$optarg
  42.     local_prefix=yes
  43.     ;;
  44.   --prefix)
  45.     echo_prefix=yes
  46.     ;;
  47.   --exec-prefix=*)
  48.     exec_prefix=$optarg
  49.     exec_prefix_set=yes
  50.     local_prefix=yes
  51.     ;;
  52.   --exec-prefix)
  53.     echo_exec_prefix=yes
  54.     ;;
  55.   --version)
  56.     echo $version
  57.     exit 0
  58.     ;;
  59.   --cflags)
  60.     echo_cflags=yes
  61.     ;;
  62.   --libs)
  63.     echo_libs=yes
  64.     ;;
  65.   *)
  66.     usage 1 1>&2
  67.     ;;
  68.   esac
  69.   shift
  70. done
  71.  
  72. if test "$local_prefix" = "yes" ; then
  73.     if test "$exec_prefix_set" != "yes" ; then
  74.       exec_prefix=$prefix
  75.     fi
  76. fi
  77.  
  78. if test "$echo_prefix" = "yes" ; then
  79.  echo $prefix
  80. fi
  81.  
  82. if test "$echo_exec_prefix" = "yes" ; then
  83.  echo $exec_prefix
  84. fi
  85.  
  86. if test "$echo_cflags" = "yes" ; then
  87.  cflags="-I${includedir} ${freetypecflags} ${fontconfigcflags} ${xrendercflags}"
  88.  echo $cflags
  89. fi
  90.  
  91. if test "$echo_libs" = "yes" ; then
  92.  libs="-lXft -lX11 ${freetypelibs} ${fontconfiglibs} ${xrenderlibs}"
  93.  if test "${libdir}" != "/usr/lib" ; then
  94.   echo -L${libdir} $libs
  95.  else
  96.   echo $libs
  97.  fi
  98. fi
  99.  
  100. # EOF
  101.